<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class History extends MY_Controller
{
	public function __construct()
	{
		parent::__construct();
		$this->load->model('History_model', 'history');
        $login_status  = $this->check_login_status();
        if (empty($login_status)){
            redirect('/login/index');die;
        }
	}

    public function index()
    {

        $_SESSION['sidebar'] = "history";  
        $per_page = $this->input->get('per_page') ? $this->input->get('per_page') : 0;
        $limit = 20;
        $total_rows = $this->history->getMyHistoryListCnt();
        $base_url = '/history/index?';
        $page_links = $this->create_page_links($base_url,$total_rows,$limit);
        $historyList = $this->history->getMyHistoryList(" * ",$per_page, $limit);
        $data = array(
            'historyList'=>$historyList,
            'page_links'=>$page_links,
            'per_page'=>$per_page,
            );
        $this->load->view("history/index", $data);
    }
}
/* End of file Index.php */
/* Location: ./application/controllers/history.php */
